package com.techysky.config;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.context.ApplicationContext;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

import com.techysky.service.ProjectService;

@Component
@Order(2)
public class Init implements CommandLineRunner {
	
	@Autowired
	ApplicationContext context;

	@Override
	public void run(String... args) throws Exception {
	
		context.getBean(ProjectService.class).initProject();
		System.out.println("初始化项目结束=====================");
		System.out.println("开始启动浏览器====================");
		/*String cmd="cmd /c start iexplore -k //127.0.0.1:8082";
		Runtime run = Runtime.getRuntime();
         try{
             run.exec(cmd);
            System.out.println("启动浏览器打开项目成功");
         }catch (Exception e){
             e.printStackTrace();
             System.out.println("启动浏览器打开项目失败");
         }
	   
			*/
	}

}
